﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.Data.Linq;
using System.Data.Linq.Mapping;

using Ordinaire.Db.Linq;
using Ordinaire.Security;
using Ordinaire.Security.Model;
using Ordinaire.Taxonomy;
using Ordinaire.Tool;
using Ordinaire.Pos.Model;

namespace Ordinaire.Pos.Win
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            OrdinaireContext.SetFileOrServerOrConnection(@"Data Source=jloe-PC\SQLEXPRESS;Initial Catalog=pos;Integrated Security=SSPI;");

            //string hash = Cryptographer.Hash("admin");
            //bool matches = Cryptographer.VerifyHash("Hello World", hash);

            //User admin = UserManager.Instance.Authenticate("admin", "admin");

            //User user = new User();
            //user.Id = "admin";
            //user.Name = "Administrator 1";
            //UserManager.Instance.Update(user);

            //List<User> users = UserManager.Instance.GetUsers();
            //List<Role> roles = UserManager.Instance.GetRolesByUserid("admin");

            //bool success = UserManager.Instance.ChangePassword("admin", "admin", "admin1");

            //string password = String.Empty;
            //User user = UserManager.Instance.CreateUser("jloe", "Jonathan Loe", out password);

            //string name = Reflection.GetTableAttribute(new User());
            //Dish dish = new Dish();
            //dish.Id = 1;
            //dish.Name = "Satay Chicken";
            //Librarian.Instance.Tag(dish, "Main");
        }
    }
}
